import request from '@/utils/request'

// 定义公共的api 
const BASE_URL = '/admin/system/sysUser';

export default{
    // 查询用户和分页
    getPageList(page,limit,searchObj){
        return request({
          url:`${BASE_URL}/${page}/${limit}`,
          method: 'get',
          params:searchObj
        })
      },
      //删除
      deleteById(id){
        return request({
          url:`${BASE_URL}/deleteUserByiD/${id}`,
          method:'delete',
        })
      },
      //批量删除
      deleteUserIds(ids){
        return request({
          url:`${BASE_URL}/deleteIds`,
          method:'delete',
          data:ids,
        })
      },
      //根据id去查询信息
      findUserById(id){
        return request({
          url:`${BASE_URL}/selectUserById/${id}`,
          method:'get',
        })
      },
      //添加用户
      addUser(sysUser){
        return request({
          url:`${BASE_URL}/addUser`,
          method:'post',
          data:sysUser
        })
      },
      //修改用户
      updateUser(sysUser){
        return request({
          url:`${BASE_URL}/updateUser`,
          method:'post',
          data:sysUser
        })
      },
      //修改用户状态
      updatesysUser(searchObj){
        return request({
          url:`${BASE_URL}/updatesysUser`,
          method:'post',
          data:searchObj
        })
      }
}